const crypto = require('crypto')
const moment = require('moment')

// 定义钥匙
const SECRET_KEY = 'Wjio_123#.';

// 定义规则
const md5 = (content) => {
  return crypto.createHash('md5').update(content).digest('hex')
}

module.exports = {
  // 定义加密函数
  getPassword: (password) => {
    return md5(`password=${password}&secret_key=${SECRET_KEY}`)
  },
  getTimer: (time) => {
    return moment(time).format('YYYY-MM-DD')
  }
}